import request from '@/utils/request'

// 查询公寓信息列表
export function listElderlyapartment(query) {
  return request({
    url: '/business/elderlyapartment/list',
    method: 'get',
    params: query
  })
}

// 查询公寓信息详细
export function getElderlyapartment(apartmentId) {
  return request({
    url: '/business/elderlyapartment/' + apartmentId,
    method: 'get'
  })
}

// 新增公寓信息
export function addElderlyapartment(data) {
  return request({
    url: '/business/elderlyapartment',
    method: 'post',
    data: data
  })
}

// 修改公寓信息
export function updateElderlyapartment(data) {
  return request({
    url: '/business/elderlyapartment',
    method: 'put',
    data: data
  })
}

// 删除公寓信息
export function delElderlyapartment(apartmentId) {
  return request({
    url: '/business/elderlyapartment/' + apartmentId,
    method: 'delete'
  })
}

export function getElderlyStatistics() {
  return request({
    url: '/business/elderlyapartment/Statistics',
    method: 'post'
  })
}

export function getElderApartment() {
  return request({
    url: '/business/elderlyapartment/allList',
    method: 'post',
  })
}

export function getApartmentRoomTree() {
  return request({
    url: '/apartment/RoomTree',
    method: 'post',
  })
}
export function getRoomAndProject() {
  return request({
    url: '/apartment/getRoomType',
    method: 'post',
  })
}

export function getBannerList() {
  return request({
    url: '/apartment/getBannerList',
    method: 'post',
  })
}

export function getBanner(bannerId) {
  return request({
    url: '/apartment/getBanner',
    method: 'post',
    params: {
      bannerId:bannerId,
    }
  })
}

export function addBanner(data) {
  return request({
    url: '/apartment/addBanner',
    method: 'post',
    data: data
  })
}

// 修改公寓信息
export function updateBanner(data) {
  return request({
    url: '/apartment/updateBanner',
    method: 'post',
    data: data
  })
}
export function delBanner(bannerId) {
  return request({
    url: '/apartment/delBanner',
    method: 'post',
    params: {
      bannerId:bannerId,
    }
  })
}

